package com.library.service.impl;

import java.util.List;

import com.library.bean.Book;
import com.library.bean.Page;
import com.library.dao.BookDao;
import com.library.dao.impl.BookDaoImpl;
import com.library.service.BookService;



public class BookServiceImpl implements BookService{

	private BookDao bookDao = new BookDaoImpl();
	
	@Override
	public Page<Book> selectAll(int pageNum, int pageSize) {
		List<Book> bookList = bookDao.selectAll(pageNum,pageSize);
		int totalRows = bookDao.selectAllBookNums();
		Page<Book> page = new Page(bookList,pageNum,pageSize,totalRows);
		return page;
	}

	@Override
	public int deleteBookById(int bookId) {
		
		return bookDao.deleteBookById(bookId);
	}
	
	
}
